gtk_do_render_line (context, cr, x0, y0, x1, y1);
}
-static void
-gtk_css_style_render_frame_gap (GtkCssStyle *style,
- cairo_t *cr,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height,
- GtkPositionType gap_side,
- gdouble xy0_gap,
- gdouble xy1_gap)
-{
- gint border_width;
- gdouble x0, y0, x1, y1, xc = 0.0, yc = 0.0, wc = 0.0, hc = 0.0;
- GtkBorder border;
-
- border.top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
- border.right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
- border.bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
- border.left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
-
- border_width = MIN (MIN (border.top, border.bottom),
- MIN (border.left, border.right));
-
- cairo_save (cr);
-
- switch (gap_side)
- {
- case GTK_POS_TOP:
- xc = x + xy0_gap + border_width;
- yc = y;
- wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
- hc = border_width;
- break;
-
- case GTK_POS_BOTTOM:
- xc = x + xy0_gap + border_width;
- yc = y + height - border_width;
- wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
- hc = border_width;
- break;
-
- case GTK_POS_LEFT:
- xc = x;
- yc = y + xy0_gap + border_width;
- wc = border_width;
- hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
- break;
-
- case GTK_POS_RIGHT:
- xc = x + width - border_width;
- yc = y + xy0_gap + border_width;
- wc = border_width;
- hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
- break;
-
- default:
- g_assert_not_reached ();
- break;
- }
-
- cairo_clip_extents (cr, &x0, &y0, &x1, &y1);
- cairo_rectangle (cr, x0, y0, x1 - x0, yc - y0);
- cairo_rectangle (cr, x0, yc, xc - x0, hc);
- cairo_rectangle (cr, xc + wc, yc, x1 - (xc + wc), hc);
- cairo_rectangle (cr, x0, yc + hc, x1 - x0, y1 - (yc + hc));
- cairo_clip (cr);
-
- gtk_css_style_render_border (style, cr,
- x, y, width, height);
-
- cairo_restore (cr);
-}
-
-/**
- * gtk_render_frame_gap:
- * @context: a #GtkStyleContext
- * @cr: a #cairo_t
- * @x: X origin of the rectangle
- * @y: Y origin of the rectangle
- * @width: rectangle width
- * @height: rectangle height
- * @gap_side: side where the gap is
- * @xy0_gap: initial coordinate (X or Y depending on @gap_side) for the gap
- * @xy1_gap: end coordinate (X or Y depending on @gap_side) for the gap
- *
- * Renders a frame around the rectangle defined by (@x, @y, @width, @height),
- * leaving a gap on one side. @xy0_gap and @xy1_gap will mean X coordinates
- * for %GTK_POS_TOP and %GTK_POS_BOTTOM gap sides, and Y coordinates for
- * %GTK_POS_LEFT and %GTK_POS_RIGHT.
- *
- * Typical rendering of a frame with a gap:
- *
- * 
- **/
-void
-gtk_render_frame_gap (GtkStyleContext *context,
- cairo_t *cr,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height,
- GtkPositionType gap_side,
- gdouble xy0_gap,
- gdouble xy1_gap)
-{
- g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- g_return_if_fail (cr != NULL);
- g_return_if_fail (xy0_gap <= xy1_gap);
- g_return_if_fail (xy0_gap >= 0);
-
- if (width <= 0 || height <= 0)
- return;
-
- if (gap_side == GTK_POS_LEFT ||
- gap_side == GTK_POS_RIGHT)
- g_return_if_fail (xy1_gap <= height);
- else
- g_return_if_fail (xy1_gap <= width);
-
- gtk_css_style_render_frame_gap (gtk_style_context_lookup_style (context),
- cr,
- x, y, width, height, gap_side,
- xy0_gap, xy1_gap);
-}
-
/**
* gtk_render_handle:
* @context: a #GtkStyleContext